package com.topone.permission.controller;


import java.util.List;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import com.topone.permission.entity.Permission;
import com.topone.permission.result.Result;
import com.topone.permission.service.PermissionService;

@RestController
@RequestMapping("/permission")
public class PermissionController {
	
	@Autowired
	PermissionService permissionService;

	@RequestMapping("/get")
	public Result<?> getPermission(){
		List<Permission> list = permissionService.getPermission();
		return Result.success(list);
	}
	
	@RequestMapping("/get/roleid")
	public Result<?> findByRoleId(Long roleId){
		List<Permission> list = permissionService.findByRoleId(roleId);
		return Result.success(list);
	}
	
	

	
}
